package cn.yh.hospitalappointmentsystemdemo.controller;

import cn.yh.hospitalappointmentsystemdemo.common.AjaxResult;
import cn.yh.hospitalappointmentsystemdemo.domain.query.DoctorQuery;
import cn.yh.hospitalappointmentsystemdemo.domain.vo.DoctorVo;
import cn.yh.hospitalappointmentsystemdemo.service.IDoctorService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@Api(tags = "医生管理")
@RestController
@RequestMapping("/doctors")
public class DoctorsController {
    @Autowired
    private IDoctorService doctorService;
    @PostMapping("/getDoctors")
    public AjaxResult getDoctors(@RequestBody DoctorQuery doctorQuery){
        List<DoctorVo> doctorVos = doctorService.getDoctorsByHospital(doctorQuery);
        return AjaxResult.success(doctorVos);
    }
}


